package com.java.softproblem.exer2;

/**
 * @author luzhikun
 * @date &{DATE}-13:03
 * <p>
 * 安全的 懒汉式
 */
public class Design2 {
    public static void main(String[] args) {
        Design2Test.show();
    }
}

class Design2Test {
    private Design2Test() {

    }

    private static Design2Test design2Test = null;

    public static Design2Test show() {
        if (design2Test == null) {

            synchronized (Design2Test.class) {
                if (design2Test == null) {
                    design2Test = new Design2Test();
                }
            }

        }
        return design2Test;
    }
}